using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;

public class ScrollChild : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{
    public ScrollRectEx scrollRectEx;
    public ScrollRect scrollRect;

    public void OnBeginDrag(PointerEventData eventData)
    {
        if (scrollRectEx != null)
            scrollRectEx.OnBeginDrag(eventData);
        if (scrollRect != null)
            scrollRect.OnBeginDrag(eventData);
    }

    public void OnDrag(PointerEventData eventData)
    {
        if (scrollRectEx != null)
            scrollRectEx.OnDrag(eventData);
        if (scrollRect != null)
            scrollRect.OnDrag(eventData);
    }

    public void OnEndDrag(PointerEventData eventData)
    {
        if (scrollRectEx != null)
            scrollRectEx.OnEndDrag(eventData);
        if (scrollRect != null)
            scrollRect.OnEndDrag(eventData);
    }
}

